import request from '@/utils/request'
import {
  urlParam
} from '@/utils/index'

export function searchPoint(query) {
  return request.get('https://mangerapi.star.91yunshi.com/generator/knowledgePointTree/tree?' + urlParam(query))
}

export function queryQuestionPoint(questionId) {
  return request.get(`/question/${questionId}/point`)
}

export function saveQuestionPoint(questionId, pointId) {
  return request.put(`question/${questionId}/point/${pointId}`)
}

export function deleteQuestionPoint(questionId, pointId) {
  return request.delete(`question/${questionId}/point/${pointId}`)
}

export function questionPointSort(questionId, pointId, sort) {
  return request.put(`question/${questionId}/point/${pointId}/sort?sort=${sort}`)
}

export function knowledgePointExceedLimit(pointId) {
  return request.get(`/knowledgePoint/knowledgePointExceedLimit/${pointId}`)
}
